package zblibrary.facechat.modules.foundgood;

import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableList;

import java.util.ArrayList;
import java.util.List;

import lingxi.entity.User;
import zblibrary.facechat.entity.FoundGoodEntity;


public class FoundGoodViewModel {
    private ObservableList<FoundGoodEntity> foundGoodList;

    public int totalSize() {
        return foundGoodList.size();
    }

    public void initData() {
        foundGoodList = new ObservableArrayList<FoundGoodEntity>();
        syncData();
    }

    public void syncData() {
        ArrayList<String> photoList = new ArrayList<String>(){{}};
        foundGoodList.clear();
        for (int i = 0; i < 20; i++) {
            User user = new User();
            user.setUsername("捡到人——"+i);
            user.setAvatar("http://42.194.193.182:5000/images/goods/1.jpg");
            FoundGoodEntity entity = new FoundGoodEntity(user.getUsername(),"1234567890123");
            foundGoodList.add(entity);
        }
    }

    public List<FoundGoodEntity> getFoundGoodList() {
        return foundGoodList;
    }
}
